package com.tjetc.controller;

import com.tjetc.common.JsonResult;
import com.tjetc.dao.CategoryMapper;
import com.tjetc.entity.Category;
import com.tjetc.entity.Merchant;
import com.tjetc.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("shop")
public class ShopController {
    @Autowired
    private MerchantService merchantService;

    /***
     * 查询所有店铺
     * @return
     */
    @RequestMapping("all")
    public JsonResult selectAll(){
        return new JsonResult<>(0, "", merchantService.selectAllMerchant());
    }

    /***
     * 查询所有包含甜点的店铺
     * @return
     */
    @RequestMapping("allsweet")
    public JsonResult selectSweet(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(1));
    }
    /***
     * 查询所有包含饮品的店铺
     * @return
     */
    @RequestMapping("alldrink")
    public JsonResult selectDrink(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(2));
    }
    /***
     * 查询所有包含小吃的店铺
     * @return
     */
    @RequestMapping("allsnack")
    public JsonResult selectSnack(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(3));
    }
    /***
     * 查询所有包含早餐的店铺
     * @return
     */
    @RequestMapping("allBreakfast")
    public JsonResult selectBreakfast(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(4));
    }
    /***
     * 查询所有包含果蔬的店铺
     * @return
     */
    @RequestMapping("allFruit")
    public JsonResult selectFruit(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(5));
    }
    /***
     * 查询所有包含卤味的店铺
     * @return
     */
    @RequestMapping("allMeat")
    public JsonResult selectMeat(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(6));
    }
    /***
     * 查询所有包含快餐的店铺
     * @return
     */
    @RequestMapping("allFastFood")
    public JsonResult selectFastFood(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(7));
    }
    /***
     * 查询所有包含家常菜的店铺
     * @return
     */
    @RequestMapping("allHomecook")
    public JsonResult selectHomecook(){
        return new JsonResult<>(0, "", merchantService.diffrerntType(8));
    }
    /***
     * 搜索菜品或商家的信息
     * @return
     */
    @RequestMapping("zsearch")
    public JsonResult zsearch(String searchWord){
        return new JsonResult<>(0, "", merchantService.shopAndDish(searchWord));
    }

}
